Skip to content

Use sigstore for Python artifact verification#303

Merged
agners merged 4 commits into
home-assistant:masterfrom
cdce8p:use-sigstore
Jun 10, 2025
Merged

Use sigstore for Python artifact verification#303
agners merged 4 commits into
home-assistant:masterfrom
cdce8p:use-sigstore

Conversation

@cdce8p

@cdce8p cdce8p commented Jun 4, 2025

Copy link
Copy Markdown
Member

PEP 761 deprecated the PGP signatures for CPython artifacts. Python 3.14 will only support verification with sigstore.

As all releases since 3.11.0 include sigstore bundles, we can already update all docker files to use that instead.
https://www.python.org/downloads/metadata/sigstore/

--
Also fix a minor warning in the dockerfile regarding ENV
https://docs.docker.com/reference/dockerfile/#env

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format 

@cdce8p cdce8p marked this pull request as draft June 4, 2025 11:06
Comment thread python/3.12/Dockerfile
Comment on lines +24 to +25
&& apk add --no-cache --virtual .cosign cosign \
--repository="https://dl-cdn.alpinelinux.org/alpine/v3.21/community" \

@cdce8p cdce8p Jun 5, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Python sigstore bundle use the new bundle format, the verification of which requires cosign>=4.2.0. Unfortunately alpine 3.21 is the earliest release with in this case version 4.2.1. The additional repository is necessary until 3.19 and 3.20 are dropped.

There is a draft PR to add sigstore validation to the "official" Python docker images which uses a similar approach. docker-library/python#983

https://pkgs.alpinelinux.org/packages?name=cosign&branch=v3.21&repo=&arch=x86_64&origin=&flagged=&maintainer=

@cdce8p cdce8p marked this pull request as ready for review June 6, 2025 01:07
agners

This comment was marked as duplicate.

@agners agners left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice change, thanks!

Comment thread python/3.11/Dockerfile

# ensure local python is preferred over distribution python
ENV PATH /usr/local/bin:$PATH
ENV PATH=/usr/local/bin:$PATH

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I think the space variant also did not expand $PATH... I wonder how certain things even worked with that in mind 🤔

Anyways, this is the right thing to do 👍

@cdce8p

cdce8p commented Jun 10, 2025

Copy link
Copy Markdown
Member Author

CI is all green now

@agners agners merged commit 5fec57b into home-assistant:master Jun 10, 2025
88 checks passed
@cdce8p cdce8p deleted the use-sigstore branch June 10, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants